#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Node {
   public:
    int val;
    Node* next;
    Node* random;

    Node(int _val) {
        val = _val;
        next = NULL;
        random = NULL;
    }
};

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
    vector<vector<int> > ret;
    int getSum(int start, int end) {
        return (start + end) * (end - start + 1) / 2;
    }

    void generateInt(int start, int end) {
        vector<int> tmp;
        for (int i = start; i <= end; i++) {
            tmp.push_back(i);
        }
        ret.push_back(tmp);
    }

   public:
    vector<vector<int> > findContinuousSequence(int target) {
        // 滑动窗口
        for (int i = 1; i < target / 2 + 2; i++) {
            for (int j = i + 1; j < target / 2 + 2; j++) {
                if (getSum(i, j) == target) {
                    generateInt(i, j);
                } else if (getSum(i, j) > target) {
                    break;
                }
            }
        }
        return ret;
    }
};

int main() {
    cout << "Hello, World!";
    Solution().findContinuousSequence(9);
    return 0;
}
